﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using System;
using FinPlusCompCore;
using QLNet;
using p = FinPlusCompQuant.QLConvParser;

namespace FinPlusCompQuant
{
    public class FutRate : Rate
    {
        //construct
        public FutRate(Market market, string name, double rate, DateTime startDate, int futMonths, string dayCount, string bizConv, string holidays, bool endOfMonth = true)
        {
            Id = name;
 
            Quote = market.GetQuote(name);
            Quote.linkTo(new SimpleQuote(rate));
 
            RateHelper = new FuturesRateHelper(Quote, startDate, futMonths, p.Calendar(holidays), p.BizConv(bizConv), endOfMonth, p.DayCount(dayCount));
            market.SetRateHelper(name, RateHelper);
        }
    }
}
